<?php
class JSWidget extends CWidget
{
	public $controller = "";
    public function init()
    {
		ob_start();
        // this method is called by CController::beginWidget()
    }
 
    public function run()
    {
		$this->controller->JS = ob_get_clean();
        // this method is called by CController::endWidget()
    }
}